← Index
NYTProf Performance Profile   
For /usr/share/koha/opac/cgi-bin/opac/opac-search.pl
  Run on Tue Oct 15 17:10:45 2013
Reported on Tue Oct 15 17:12:56 2013

Filename(eval 1127)[/usr/share/perl/5.10/CGI.pm:869]
StatementsExecuted 60 statements in 134µs
Eval Invoked At/usr/share/perl/5.10/CGI.pm line 869
Sibling evals1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
222183µs2.04msCGI::::urlCGI::url
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1
# spent 2.04ms (183µs+1.86) within CGI::url which was called 2 times, avg 1.02ms/call: # once (129µs+1.66ms) by main::RUNTIME at line 832 of CGI.pm # once (54µs+194µs) by main::RUNTIME at line 629 of /usr/share/koha/opac/cgi-bin/opac/opac-search.pl
package CGI; sub url {
227µs28µs my($self,@p) = self_or_default(@_);
# spent 8µs making 2 calls to CGI::self_or_default, avg 4µs/call
3213µs2108µs my ($relative,$absolute,$full,$path_info,$query,$base,$rewrite) =
# spent 108µs making 2 calls to CGI::Util::rearrange, avg 54µs/call
4 rearrange(['RELATIVE','ABSOLUTE','FULL',['PATH','PATH_INFO'],['QUERY','QUERY_STRING'],'BASE','REWRITE'],@p);
521µs my $url = '';
622µs $full++ if $base || !($relative || $absolute);
72800ns $rewrite++ unless defined $rewrite;
8
9210µs2147µs my $path = $self->path_info;
# spent 138µs making 1 call to CGI::AUTOLOAD # spent 8µs making 1 call to CGI::path_info
1029µs2127µs my $script_name = $self->script_name;
# spent 120µs making 1 call to CGI::AUTOLOAD # spent 7µs making 1 call to CGI::script_name
11212µs415µs my $request_uri = unescape($self->request_uri) || '';
# spent 9µs making 2 calls to CGI::Util::unescape, avg 5µs/call # spent 6µs making 2 calls to CGI::request_uri, avg 3µs/call
1229µs2235µs my $query_str = $self->query_string;
# spent 176µs making 1 call to CGI::AUTOLOAD # spent 59µs making 1 call to CGI::query_string
13
142800ns my $rewrite_in_use = $request_uri && $request_uri !~ /^\Q$script_name/;
152700ns undef $path if $rewrite_in_use && $rewrite; # path not valid when rewriting active
16
172900ns my $uri = $rewrite && $request_uri ? $request_uri : $script_name;
1826µs21µs $uri =~ s/\?.*$//s; # remove query string
# spent 1µs making 2 calls to CGI::CORE:subst, avg 500ns/call
1921µs $uri =~ s/\Q$ENV{PATH_INFO}\E$// if defined $ENV{PATH_INFO};
20# $uri =~ s/\Q$path\E$// if defined $path; # remove path
21
2221µs if ($full) {
2329µs2164µs my $protocol = $self->protocol();
# spent 136µs making 1 call to CGI::AUTOLOAD # spent 28µs making 1 call to CGI::protocol
242900ns $url = "$protocol://";
2528µs4200µs my $vh = http('x_forwarded_host') || http('host') || '';
# spent 156µs making 1 call to CGI::AUTOLOAD # spent 44µs making 3 calls to CGI::http, avg 15µs/call
2626µs2700ns $vh =~ s/\:\d+$//; # some clients add the port number (incorrectly). Get rid of it.
# spent 700ns making 2 calls to CGI::CORE:subst, avg 350ns/call
2722µs if ($vh) {
28 $url .= $vh;
29 } else {
3025µs275µs $url .= server_name();
# spent 73µs making 1 call to CGI::AUTOLOAD # spent 2µs making 1 call to CGI::server_name
31 }
3224µs24µs my $port = $self->server_port;
# spent 4µs making 2 calls to CGI::server_port, avg 2µs/call
3323µs $url .= ":" . $port
34 unless (lc($protocol) eq 'http' && $port == 80)
35 || (lc($protocol) eq 'https' && $port == 443);
362700ns return $url if $base;
3722µs $url .= $uri;
38 } elsif ($relative) {
39 ($url) = $uri =~ m!([^/]+)$!;
40 } elsif ($absolute) {
41 $url = $uri;
42 }
43
442600ns $url .= $path if $path_info and defined $path;
4521µs $url .= "?$query_str" if $query and $query_str ne '';
462400ns $url ||= '';
4728µs23µs $url =~ s/([^a-zA-Z0-9_.%;&?\/\\:+=~-])/sprintf("%%%02X",ord($1))/eg;
# spent 3µs making 2 calls to CGI::CORE:subst, avg 1µs/call
48210µs return $url;
49}
50
51
52;